const Service = require('egg').Service;


const sql = {
	productList : 
	'',
}

class ProductService extends Service {

	async productlist(state) {

		const result = await this.app.mysql.get('weshop').query(
			'select p.id, p.code, s.name, p.guide_price * 0.01 as guide_price, p.state, p.myproduct ' +
			'from new_product as p , new_product_share as s ' +
			'where p.code = s.code ' +
			'and p.company_code = ?' +
			'and p.del_flg = "0"' +
			'and p.state = ?', [this.ctx._user.company_code, state]
		);

		console.log(result);

		return result;
	}

  	
}

module.exports = ProductService;

